package com.study.springboottest.sort;

import lombok.Data;

@Data
public class Student implements Comparable<Student> {

    private String id;

    private String name;

    private int age;

    private Double score;

    @Override
    public int compareTo(Student other) {
        // 按年龄升序
        return Integer.compare(this.age, other.age);
    }
}
